import request from '@/utils/request'

// 修改库区
export const setArea = data => request.put('/api/area', data)

// 分页查询库区
export const getAreaList = params => request.get('/api/area/page', { params })

// 分页查询库区详细信息
export const getAreaDetailsList = params => request.get('/api/area/pageDetail', { params })

// 删除库区
export const delArea = params => request.delete('/api/area', { params })

// 新增库区
export const addArea = data => request.post('/api/area', data)

// 查询全部库区
export const getAllAreaList = params => request.get('/api/area/list', { params })

// 查询库区
export const queryArea = id => request.get(`/api/area/${id}`)

// 查询库区库位树
export const queryAreaTree = params => request.get('/api/area/tree', { params })

// 查询库区总览
export const areaOverview = id => request.get(`/api/area/overview/${id}`)

// 导入
export const areaImportExcel = data => request({
  method: 'POST',
  url: '/api/area/importExcel',
  data,
  headers: { 'content-type': 'multipart/form-data' }
})

// 下载
export const downloadArea = () => request({
  url: '/template/areaTemplate.xlsx',
  responseType: 'blob'
})

